package com.preknow.lianxi;

import java.util.Scanner;

public class Tu {

    int bianhao;
    String shuming;
    double menoy;
    int yuliang;

    public int getBianhao() {
        return bianhao;
    }

    public void setBianhao(int bianhao) {
        this.bianhao = bianhao;
    }

    public String getShuming() {
        return shuming;
    }

    public void setShuming(String shuming) {
        this.shuming = shuming;
    }

    public double getMenoy() {
        return menoy;
    }

    public void setMenoy(double menoy) {
        this.menoy = menoy;
    }

    public int getYuliang() {
        return yuliang;
    }

    public void setYuliang(int yuliang) {
        this.yuliang = yuliang;
    }

    public Tu(int bianhao, String shuming, double menoy, int yuliang){
        this.bianhao = bianhao;
        this.shuming = shuming;
        this.menoy = menoy;
        this.yuliang = yuliang;
    }

    public static void ss(Tu[] tus){

    }

    public void xianshi(){
        System.out.println(shuming+"---"+menoy+"---"+yuliang);
    }

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        System.out.println("1     java    33.45   50");
        System.out.println("2     jsp     55.45   150");
        System.out.println("3     ssm     77.45   250");
        System.out.println("请输入图书编号:");
        int chose = input.nextInt();
        System.out.println("请输入购买的数量:");
        int m = input.nextInt();
        double sum = 0;
        for(int i = 0;i<3;i++){
            if(chose == 1){
                if(m<0 || m>50){
                    System.out.println("请输入正确的购买数量");
                }else {
                    double pri = 33.45;
                    sum = m*pri;
                    return;
                }
            }else if(chose == 2){
                if(m<0 || m>150){
                    System.out.println("请输入正确的购买数量");
                }else {
                    double pri = 55.45;
                    sum = sum + m * pri;
                    return;
                }
            }else if(chose == 3){
                if(m<0 || m>150){
                    System.out.println("请输入正确的购买数量");
                }else {
                    double pri = 77.45;
                    sum = sum + m * pri;
                    return;
                }
            }
            System.out.println("请继续购买图书");
        }
        System.out.println(0001);
        System.out.println("订单总额为："+sum);
        Tu[] tu = new Tu[3];
        tu[0]= new Tu(1,"jsp",55.45,m);
        tu[1]= new Tu(3,"ssm",77.45,m);
        tu[2]= new Tu(2,"java",33.45,m);
        for (Tu ss:tu) {

        }
    }
}
